package com.wf.log.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.wf.log.service.LogService;

@Controller
@RequestMapping(value="log")
public class LogController {

	@Autowired
	private LogService logService;
	/**
	 * 日志访问总数量
	 * @return
	 */
	@RequestMapping(value="/logCount",method=RequestMethod.GET)
	public String logCount(@RequestParam(defaultValue="-1") String key,ModelMap map){
		if(key.equals("wfroot")){
			map.put("count", logService.getArticleInfoCount());
			return "log/logCount";
		}
		return "myblog/index";
	}
}
